package com.fcscs.ecms.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.fcscs.core.dao.Dao;
import com.fcscs.cservice.domain.ThemeItem;

@Repository
public interface ECMSThemeDao extends Dao {
	
	/**
	 * @param id
	 * @return
	 */
	ThemeItem getThemeItem(long id);
	
	/**
	 * @param orgId
	 * @param propId
	 * @param isCurrent
	 * @return
	 */
	List<ThemeItem> getThemeItemList(long orgId, long propId, boolean isCurrent); //isCurrent true: current; false: scheduled

	/**
	 * @param orgId
	 * @param propId
	 * @param versionId
	 * @return
	 */
	List<ThemeItem> getThemeItemList(long orgId, long propId, long versionId); //get specified version data

	/**
	 * @param tiList
	 * @return
	 */
	List<ThemeItem> saveThemeItemList(List<ThemeItem> tiList); //used to save display order

	/**
	 * @param ti
	 * @return
	 */
	ThemeItem createThemeItem(ThemeItem ti);

	/**
	 * @param ti
	 * @return
	 */
	ThemeItem saveThemeItem(ThemeItem ti);
	
	/**
	 * @param ti
	 * @return
	 */
	boolean deleteThemeItem(ThemeItem ti);

	/**
	 * @param ti
	 * @return
	 */
	boolean permDeleteThemeItem(ThemeItem ti);
	
	/**
	 * @param orgId
	 * @param propId
	 * @param name
	 * @param id
	 * @param versionId
	 * @return
	 */
	boolean isThemeItemTaken(long orgId, long propId, String name, Long id, long versionId);

	/**
	 * @param orgId
	 * @param propId
	 * @return
	 */
	List<com.fcscs.cservice.domain.model.ThemeItem> getThemeItemViewList(long orgId, long propId); //used by web service, get current version
}
